<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>栏目列表</title>
		<meta name="keywords" content="" />
		<meta name="description" content="" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<% include("/admin/resource/common_css.html"){} %>
	</head>
	<body>
		<% include("/admin/common/header.html"){} %>
		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>
			<div class="main-container-inner">
			 <% include("/admin/common/menu.html",{currentstr:"系统"}){} %>
				<div class="main-content">
					<% include("/admin/common/breadcrumb.html",{breadaddfirst:"系统管理",breadaddsecond:"菜单管理",breadaddthird:"菜单列表"}){} %>
					<div class="page-content" id="content">
				       <table>
		                 <tr>
		                  <td><a href="${ctx!}/admin/auth/menu/add" class="btn btn-success addbtn">添加</a></td>
						 </tr> 
					   </table>
				     <div  id="chnllist" style="margin-top: 40px;">
				 </div><!-- /.page-content -->
				</div><!-- /.main-content -->
				<% include("/admin/common/acesetting.html"){}%>
			</div><!-- /.main-container-inner -->
		</div><!-- /.main-container -->
	<% include("/admin/common/footer.html"){} %>
	<% include("/admin/resource/common_js.html"){} %>
    <script type="text/javascript" src="${ctx!}/plugin/zTree/js/TreeGrid.js"></script>  
    <script type="text/javascript" src="${ctx!}/plugin/zTree/js/jquery.ztree.core-3.5.js"></script>    
	<script type="text/javascript" charset="utf-8" src="${ctx!}/js/admin/auth/menu.js"> </script>
	<script language="javascript">
	    var url="${ctx!}/admin/auth/menu/loadMenuData?type=jsonTreeGrid";
	    var treeNode;
	    $.ajax({  
	        async : false,  
	        cache:false,  
	        type: 'POST',  
	        dataType : "json",  
	        url: url,//请求的action路径  
	        error: function () {//请求失败处理函数  
	            alert('请求失败');  
	        },  
	        success:function(data){ //请求成功后处理函数。    
	            treeNode = data;   //把后台封装好的简单Json格式赋给treeNodes  
	        }  
	   }); 
		var config = {
			id: "tg1",
			width: "800",
			renderTo: "chnllist",
			headerAlign: "left",
			headerHeight: "30",
			dataAlign: "left",
			indentation: "20",
			folderOpenIcon: "${ctx!}/plugin/zTree/img/folderOpen.png",
			folderCloseIcon: "${ctx!}/plugin/zTree/img/folderClose.png",
			defaultLeafIcon: "${ctx!}/plugin/zTree/img/defaultLeaf.png",
			hoverRowBackground: "false",
			folderColumnIndex: "0",
			itemClick: "itemClickEvent",
			columns:[ 
				{headerText: "名称", dataField: "name", headerAlign: "left", handler: "customOrgName"},
				{headerText: "是否显示", dataField: "isdisplay", headerAlign: "center", dataAlign: "center", width: "100"},
				{headerText: "操作", dataField: "id", headerAlign: "center",dataAlign: "center", width: "150", handler: "customLook"}
			],
			data:treeNode
		};
		function customLook(row, col){
			var id = row[col.dataField] || "";  
			return "<a href='${ctx!}/admin/auth/menu/detail?id="+id+"'  class='btn btn-info'>编辑</a>&nbsp;<a href='#'onclick='delrow(\"${ctx!}/admin/auth/menu/delete\",this,\""+id+"\")' class='btn btn-danger'>删除</a>";
		}
		//创建一个组件对象
		var treeGrid = new TreeGrid(config);
		treeGrid.show();
	</script>
	</body>
</html>
